package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.dto.ConfigUpdateDto;
import com.ydd.entity.SysConfig;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Description TODO
 * @Author fang
 * @Date 2023-05-29 16:05
 */
@Mapper
public interface SysConfigMapper extends BaseMapper<SysConfig> {
    /**
     * AdminIndexService-profile
     * @return
     */
    @Select("select attr_value from sys_config where attr_key in ('login_title','login_bg','system_name','system_logo','web_ico')")
    ArrayList<String> getConfig();

    /**
     * SysConfigService-getAllConfig
     * @return
     */
    List<SysConfig> getConfigForm();

    /**
     * SysConfigService-getAllConfig
     * 获取所有配置数据
     * @return
     */
    String getConfigRules();

    /**
     * SysConfigService-getAllConfigget-AllDataList
     * 获取所有配置数据
     * @return
     */
    List<SysConfig> getAllConfig();

    /**
     *  SysConfigService-getAllConfig-getConfigLists
     *  获取所有配置数据
     * @return
     */
    List<String> getTabValue();

    /**
     *  SysConfigService-getAllConfig-getConfigLists
     *  获取所有配置数据
     * @return
     */
    List<String> getGroupValue(String tabValue);

    /**
     * SysConfigService-getAllConfig-getConfigLists
     * @param groupValue
     * @return
     */
    List<SysConfig> getConfigByGroupValue(String groupValue);

    /**
     * SysConfigService-update
     * @param
     */
    void updateConfig(ConfigUpdateDto info);
}
